package graphic.primitives.town;

import graphic.primitives.general.GraphicObject;
import graphic.primitives.general.IGraphicObject;
import java.awt.Color;

/**
 *
 * @author Tomas Zima, Vit Terl
 */
public class Bench extends GraphicObject implements IGraphicObject
{
	public Bench(int x, int y)
	{
		super(x, y);
	}

	@Override
	public void redraw()
	{
		mainWindow.setColor(new Color(0.51f, 0.3f, 0.02f));
		
		for (int i = 0; i < 10; i++)
		{
			mainWindow.line(x + i, y - i, x + 100 + i, y - i);
		}
		
		for (int i = 0; i < 5; i++)
		{
			mainWindow.line(x + i, y + 20, x + i, y);
			mainWindow.line(x + 95 + i, y + 20, x + 95 + i, y);
			mainWindow.line(x + 10 + i, y - 5, x + 10 + i, y + 15);

			mainWindow.line(x + 105 + i, y - 8, x + 105 + i, y + 15);
		}
		
		/*mainWindow.line(x + 10, y - 10, x + 10, y - 30);
		mainWindow.line(x + 100, y - 10, x + 10, y - 30);*/
		for (int i = 3; i < 30; i++)
		{
			if (i > 12 && i < 15)
			{
				continue;
			}
			
			mainWindow.line(x + 10, y - 10 - i, x + 110, y - 10 - i);
		}
		
		mainWindow.setColor(Color.BLACK);
		
		for (int i = 0; i < 3; i++)
		{
			mainWindow.line(x + 10 + i, y - 10, x + 10 + i, y - 40);
			mainWindow.line(x + 108 + i, y - 10, x + 108 + i, y - 40);
		}
	}
}
